<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: inc.set_mail_signatur.php 534 2015-02-28 11:46:27Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 534 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2015-02-28 11:46:27 +0000 (Sat, 28 Feb 2015) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

function set_mail_signatur(&$smarty) {
	global $db;

	$signatursmarty = new Smarty;
	$signatursmarty->caching = false;

	$adresse = $db->db_query("SELECT 
									entry_firstname, 
									entry_lastname, 
									entry_street_address, 
									entry_postcode, 
									entry_city 
								FROM 
									".TABLE_ADDRESS_BOOK." 
								WHERE 
									customers_id = 1");

	$signatursmarty->assign('SHOP_NAME',STORE_NAME);
	$signatursmarty->assign('SHOP_BESITZER',STORE_OWNER);
	$signatursmarty->assign('SHOP_USTID',STORE_OWNER_VAT_ID);
	$signatursmarty->assign('SHOP_ADRESSE_VNAME',$adresse->fields['entry_firstname']);
	$signatursmarty->assign('SHOP_ADRESSE_NNAME',$adresse->fields['entry_lastname']);
	$signatursmarty->assign('SHOP_ADRESSE_STRASSE',$adresse->fields['entry_street_address']);
	$signatursmarty->assign('SHOP_ADRESSE_PLZ',$adresse->fields['entry_postcode']);
	$signatursmarty->assign('SHOP_ADRESSE_ORT',$adresse->fields['entry_city']);
	$signatursmarty->assign('SHOP_EMAIL',STORE_OWNER_EMAIL_ADDRESS);
	$signatursmarty->assign('SHOP_URL',HTTP_SERVER);

	$signatur_html = $signatursmarty->fetch(CURRENT_TEMPLATE.'/mails/signatur.html');
	$signatur_text = $signatursmarty->fetch(CURRENT_TEMPLATE.'/mails/signatur.txt');

	$smarty->assign('EMAIL_signatur_html', utf8_encode($signatur_html));
	$smarty->assign('EMAIL_signatur_txt', utf8_encode($signatur_text));

};